import request from '@/utils/request'
import { otherFiltersItem } from '@/utils'

// 保存开业新增
export function saveOpenData(data) {
  return request({
    url: '/api/v1/shopOpening/insertShopOpening',
    method: 'put',
    data
  })
}
// 根据id查询详细信息
export function getDetailById(id) {
  return request({
    url: `/api/v1/shopOpening/${id}`,
    method: 'get'
  })
}

// 开业申请提交,开业执行,开业审核
export function saveOpenState(data) {
  return request({
    url: '/api/v1/shopOpening/updateShopOpening',
    method: 'post',
    data
  })
}
/**
 * 根据所属模块获取文件列表
 * @returns
 */
export function postConfigAttachmentTemplate() {
  const data = new FormData()
  data.append('filtersRaw', JSON.stringify([otherFiltersItem('belongModel', 'SHOP_OPENING', '=')]))
  return request({
    url: '/api/v1/configAttachmentTemplate/page',
    method: 'POST',
    data
  })
}
// 任务终止
export function terminalTask(data) {
  return request({
    url: '/api/v1/shopOpening/stopShopOpening',
    method: 'post',
    data
  })
}

